package tech.aistar.mapper;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;
import tech.aistar.entity.Questionpaper;

import java.util.List;

@Repository
public interface QuestionpaperMapper {

    @Select("select * from questionpaper")
    List<Questionpaper> findAll();

    @Select("select * from questionpaper where paper_id = #{value}")
    List<Questionpaper> findById(Long id);

    @Select("select que_id from questionpaper where paper_id = #{paperId} and que_type = #{queType}")
    Integer findqueId(@Param("paperId") Long paperId, @Param("queType") Long queType);

    @Select("select count(*) from questionpaper where paper_id = #{paperId} and que_type = #{queType}")
    Long countType(@Param("paperId") Long paperId, @Param("queType") Long queType);


}
